<?php

namespace Api\MemberServer;

use Illuminate\Support\ServiceProvider as BaseServiceProvider;

/**
 * 服务提供者
 */
class ServiceProvider extends BaseServiceProvider
{
    /**
     * Register any application services.
     * 服务注册时执行，此处仅可用于注册 Ioc 绑定
     * @return void
     */
    public function register()
    {
        // 注册配置文件
        config()->set('MemberServer', require __DIR__.'/config.php');

        // 注册 Ioc 绑定
        $this->app->when(Open\MemberServerRepository::class)
            ->needs('$config')
            ->give(config('MemberServer'));
    }

}
